<script setup>

import { ref } from 'vue'
//参数为单项数据传递
// ROOT <- Button <- Submit
//ROOT -> Button -> Submit
//step：只能在父组件进行修改，不能在子组件进行修改


const props = defineProps({
    msg: {
        type:Number,
 }
})
const emit = defineEmits(['updateMsg'])
//子组件内不能修改父组件的值
const modifyMsg = () => {
   emit('updateMsg')
}
</script>
<template>
    <div>
        {{ msg }}<br>
        <button placeholder="请输入值" type="button"  @click="modifyMsg">修改</button>
    </div>
</template>

<style scoped> 
 
</style>